import 'package:flutter/material.dart';
import 'package:homepad/styles.dart';

class PanelTitleHeader extends StatelessWidget {
  final String title;
  final String subtitle;
  final String extra;
  final double height;
  final double width;

  const PanelTitleHeader({
    super.key,
    required this.title,
    required this.subtitle,
    this.extra = "",
    this.height = 90,
    required this.width,
  });

  @override
  Widget build(BuildContext context) {
    final MyStyles styles = Theme.of(context).extension<MyStyles>()!;
    final textStyle = styles.homeWeatherTemperatureTextStyle.copyWith(
      letterSpacing: 1,
      fontSize: 32,
      shadows: [
        const Shadow(
          blurRadius: 4.0,
          color: Color.fromARGB(50, 0, 0, 0),
          offset: Offset(1.0, 2.0),
        )
      ],
    );

    return SizedBox(
      height: height,
      width: width,
      child: Stack(
        children: [
          Positioned(
              top: 15,
              left: 20,
              child: Text(title, style: styles.textStyle)),
          Positioned(
              top: 38,
              left: 20,
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Text(subtitle, style: textStyle),
                  Padding(
                      padding: const EdgeInsets.only(top: 5),
                      child: Text(extra, style: textStyle.copyWith(fontSize: 26))
                  )
                ],
              )
          ),
        ],
      ),
    );
  }
}
